//用户管理模块API
import axios from '../axios'

//保存用户
export const save = (data) => {
  return axios({
    url: '/user/save',
    method: 'post',
    data: data
  })
};

//查询所有用户
export const findAll = () => {
  return axios({
    url: "/user/findAll",
    method: 'get'
  })
};

//删除用户
export const batchDelete = (data) => {
  return axios({
    url: '/user/delete',
    method: 'post',
    data: data
  })
};

//分页查询
export const findPage = (data) => {
  return axios({
    url: '/user/findPage',
    method: 'post',
    data: data
  })
};

//根据名称查询
export const findByName = (param) => {
  return axios({
    url: '/user/findByName',
    method: 'get',
    params: param
  })
};

//查询用户权限
export const findPermissions = (param) => {
  return axios({
    url: '/user/findPermissions',
    method: 'get',
    params: param
  })
};

//查询用户角色
export const findUserRoles = (param) => {
  return axios({
    url: '/user/findUserRoles',
    method: 'get',
    params: param
  })
};

//修改密码
export const resetPassword = (data) => {
  return axios({
    url: '/user/password/reset',
    method: 'post',
    data: data
  })
};
